/*
 * Generated by XDoclet - Do not edit!
 */
package hotel.interfaces;

/**
 * Value object for Reserva.
 *
 * @xdoclet-generated at ${TODAY}
 * @copyright The XDoclet Team
 * @author XDoclet
 * @version ${version}
 */
public class ReservaValue
   extends java.lang.Object
   implements java.io.Serializable 
{
   private java.lang.Integer ID;
   private boolean IDHasBeenSet = false;
   private java.util.Date desdeData;
   private boolean desdeDataHasBeenSet = false;
   private java.util.Date finsData;
   private boolean finsDataHasBeenSet = false;

   private hotel.interfaces.ReservaPK pk;

   public ReservaValue()
   {
	  pk = new hotel.interfaces.ReservaPK();
   }

   public ReservaValue( java.lang.Integer ID,java.util.Date desdeData,java.util.Date finsData )
   {
	  this.ID = ID;
	  IDHasBeenSet = true;
	  this.desdeData = desdeData;
	  desdeDataHasBeenSet = true;
	  this.finsData = finsData;
	  finsDataHasBeenSet = true;
	  pk = new hotel.interfaces.ReservaPK(this.getID());
   }

   //TODO Cloneable is better than this !
   public ReservaValue( ReservaValue otherValue )
   {
	  this.ID = otherValue.ID;
	  IDHasBeenSet = true;
	  this.desdeData = otherValue.desdeData;
	  desdeDataHasBeenSet = true;
	  this.finsData = otherValue.finsData;
	  finsDataHasBeenSet = true;

	  pk = new hotel.interfaces.ReservaPK(this.getID());
   }

   public hotel.interfaces.ReservaPK getPrimaryKey()
   {
	  return pk;
   }

   public void setPrimaryKey( hotel.interfaces.ReservaPK pk )
   {
      // it's also nice to update PK object - just in case
      // somebody would ask for it later...
      this.pk = pk;
	  setID( pk.ID );
   }

   public java.lang.Integer getID()
   {
	  return this.ID;
   }

   public void setID( java.lang.Integer ID )
   {
	  this.ID = ID;
	  IDHasBeenSet = true;

		 pk.setID(ID);
   }

   public boolean IDHasBeenSet(){
	  return IDHasBeenSet;
   }
   public java.util.Date getDesdeData()
   {
	  return this.desdeData;
   }

   public void setDesdeData( java.util.Date desdeData )
   {
	  this.desdeData = desdeData;
	  desdeDataHasBeenSet = true;

   }

   public boolean desdeDataHasBeenSet(){
	  return desdeDataHasBeenSet;
   }
   public java.util.Date getFinsData()
   {
	  return this.finsData;
   }

   public void setFinsData( java.util.Date finsData )
   {
	  this.finsData = finsData;
	  finsDataHasBeenSet = true;

   }

   public boolean finsDataHasBeenSet(){
	  return finsDataHasBeenSet;
   }

   public String toString()
   {
	  StringBuffer str = new StringBuffer("{");

	  str.append("ID=" + getID() + " " + "desdeData=" + getDesdeData() + " " + "finsData=" + getFinsData());
	  str.append('}');

	  return(str.toString());
   }

   /**
    * A Value Object has an identity if the attributes making its Primary Key have all been set. An object without identity is never equal to any other object.
    *
    * @return true if this instance has an identity.
    */
   protected boolean hasIdentity()
   {
	  boolean ret = true;
	  ret = ret && IDHasBeenSet;
	  return ret;
   }

   public boolean equals(Object other)
   {
      if (this == other)
         return true;
	  if ( ! hasIdentity() ) return false;
	  if (other instanceof ReservaValue)
	  {
		 ReservaValue that = (ReservaValue) other;
		 if ( ! that.hasIdentity() ) return false;
		 boolean lEquals = true;
		 if( this.ID == null )
		 {
			lEquals = lEquals && ( that.ID == null );
		 }
		 else
		 {
			lEquals = lEquals && this.ID.equals( that.ID );
		 }

		 lEquals = lEquals && isIdentical(that);

		 return lEquals;
	  }
	  else
	  {
		 return false;
	  }
   }

   public boolean isIdentical(Object other)
   {
	  if (other instanceof ReservaValue)
	  {
		 ReservaValue that = (ReservaValue) other;
		 boolean lEquals = true;
		 if( this.desdeData == null )
		 {
			lEquals = lEquals && ( that.desdeData == null );
		 }
		 else
		 {
			lEquals = lEquals && this.desdeData.equals( that.desdeData );
		 }
		 if( this.finsData == null )
		 {
			lEquals = lEquals && ( that.finsData == null );
		 }
		 else
		 {
			lEquals = lEquals && this.finsData.equals( that.finsData );
		 }

		 return lEquals;
	  }
	  else
	  {
		 return false;
	  }
   }

   public int hashCode(){
	  int result = 17;
      result = 37*result + ((this.ID != null) ? this.ID.hashCode() : 0);

      result = 37*result + ((this.desdeData != null) ? this.desdeData.hashCode() : 0);

      result = 37*result + ((this.finsData != null) ? this.finsData.hashCode() : 0);

	  return result;
   }

}
